﻿using Anke.SHManage.Model;
using Anke.SHManage.MSSQLDAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Anke.SHManage.IDAL;
using Anke.SHManage.Utility;

namespace Anke.SHManage.BLL
{
    public partial class C_OilCardInfoBLL : BaseBLL<C_OilCardInfo>
    {
      private C_OilCardInfoDAL dal = new C_OilCardInfoDAL();

        //查询油卡列表
      public object GetCardList(int pageSize, int pageIndex,string isFanBan, string isActive, string cardCode, string driverWorkID, string driverName,
                                string centerID,string stationID,E_StatisticsPermisson em ,string selfWorkCode,string selfCenterID,string selfStationID)
                                          
        {
            return dal.GetCardList(pageSize, pageIndex,isFanBan, isActive, cardCode, driverWorkID, driverName,centerID,stationID, em,selfWorkCode, selfCenterID, selfStationID);              
        }
      //取C_OilCardInfo表中id最大的一条数据
      public List<C_OilCardInfo> GetMaxID()
      {
          string sql = @" select * from C_OilCardInfo where id in (select max(id) from C_OilCardInfo)";
          return base.DALContext.IC_OilCardInfoDAL.ExcuteSqlToList(sql);
      }

      //取卡号(所有的)
      public object GetCardCodeList(E_StatisticsPermisson em, string selfCenterID, string selfStationID, string selfWorkCode)
      {
          return dal.GetCardCodeList(em, selfCenterID, selfStationID, selfWorkCode);
      }
      //取卡号(有效的)
      public object GetYXCardCodeList(E_StatisticsPermisson em, string selfCenterID, string selfStationID, string selfWorkCode)
      {
          return dal.GetYXCardCodeList(em, selfCenterID, selfStationID, selfWorkCode);
      }
      //取卡号(所有的)判断卡号是否已经存在的
      public object GetYXCardCode()
      {
          return dal.GetYXCardCodes();
      }
      //取司机姓名
      public object GetDriverNamesList()
      {
          return dal.GetDriverNamesList();
      }
      //取司机工号
      public object GetDriverWorkIDList(E_StatisticsPermisson em,string selfCenterID,string selfStationID,string selfWorkCode)
      {
          return dal.GetDriverWorkIDList(em, selfCenterID, selfStationID, selfWorkCode);
      }
      //取负责人工号
      public object GetWorkIDList()
      {
          return dal.GetWorkIDList();
      }
      //根据司机工号取司机姓名
      public object GetDriverNameLists(string driverWorkID)
      {
          return dal.GetDriverNameList(driverWorkID);
      }
      //根据姓名取工号
      public object GetWorkIDLists(string name)
      {
          return dal.GetWorkIDLists(name);
      }
      //取姓名
      public object GetNameList()
      {
          return dal.GetNameList();
      }
      //取工号
      public object GetWorkCode()
      {
          return dal.GetWorkID();
      }
      //根据司机工号取司机姓名
      public C_OilCardLink GetOilCardLinkList(string workID)
      {
          return dal.GetOilCardLinkList(workID);
      }
      //根据ID查出一条数据
      public C_OilCardInfo GetModelList(int ID)
      {
          return dal.GetModelList(ID);
      }
      //取和当前选中卡有关的卡的信息列表
      public object GetLink(int pageIndex,int pageSize,string linkCardCode)
      {
          return dal.GetLink(pageIndex, pageSize, linkCardCode);
      }
    }
}
